import { request } from '@/utils/request';

let url = 'http://localhost:5177'

export const menuApi = {
  // 获取菜单列表
  getMenus: () => request('get', `${url}/api/menu`),

  // 获取菜单树结构
  getMenuTree: () => request('get', `${url}/api/menu/tree`),

  // 创建菜单
  createMenu: (data) => request('post', `${url}/api/menu`, data),

  // 更新菜单
  updateMenu: (id, data) => request('put', `${url}/api/menu/${id}`, data),

  // 删除菜单
  deleteMenu: (id) => request('delete', `${url}/api/menu/${id}`),

  // 启用菜单
  enableMenu: (id) => request('patch', `${url}/api/menu/${id}/enable`),

  // 禁用菜单
  disableMenu: (id) => request('patch', `${url}/api/menu/${id}/disable`)
}



